import KBEngine


def countNPC():
    i = 0
    for e in KBEngine.entities.values():
        if e.__class__.__name__ == 'NPC':
            i += 1
    return i


def setup():
    KBEngine.addWatcher('npc count', 'UINT32', countNPC)
